import React,{useState} from 'react'
import './BallView.scss'
export default function BallView() {
  console.log('--------render-------------');
  const [list,setList]=useState([1,2,3,4,5])
  return (
    <div className='ball'>
        {
            list.map(item=><div className='item' key={item}>{item}</div>)
        }
        <div className='add' onClick={()=>{
            // list.push(6)
            // setList(list)
            setList([...list,6])
        }}>+</div>
    </div> 
  )
} 
